a11y: Add some parser tests
authorMatthias Clasen <mclasen@redhat.com>
Sun, 25 Oct 2020 17:01:44 +0000 (13:01 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 25 Oct 2020 17:01:44 +0000 (13:01 -0400)
Checking basic support for acessible states, properties
and relations in ui files.

testsuite/gtk/ui/a11y1.expected [new file with mode: 0644]
testsuite/gtk/ui/a11y1.ui [new file with mode: 0644]
testsuite/gtk/ui/a11y2.expected [new file with mode: 0644]
testsuite/gtk/ui/a11y2.ui [new file with mode: 0644]
testsuite/gtk/ui/a11y3.expected [new file with mode: 0644]
testsuite/gtk/ui/a11y3.ui [new file with mode: 0644]

diff --git a/testsuite/gtk/ui/a11y1.expected b/testsuite/gtk/ui/a11y1.expected
new file mode 100644 (file)
index 0000000..ff43ca4
--- /dev/null
@@ -0,0 +1 @@
+SUCCESS
diff --git a/testsuite/gtk/ui/a11y1.ui b/testsuite/gtk/ui/a11y1.ui
new file mode 100644 (file)
index 0000000..e185ca9
--- /dev/null
@@ -0,0 +1,15 @@
+<!-- test accessible states with a variety of values -->
+<interface>
+  <object class="GtkButton">
+    <accessibility>
+      <state name="busy">t</state>
+      <state name="checked">mixed</state>
+      <state name="disabled">true</state>
+      <state name="expanded">undefined</state>
+      <state name="hidden">True</state>
+      <state name="invalid">grammar</state>
+      <state name="pressed">undefined</state>
+      <state name="selected">0</state>
+    </accessibility>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/a11y2.expected b/testsuite/gtk/ui/a11y2.expected
new file mode 100644 (file)
index 0000000..ff43ca4
--- /dev/null
@@ -0,0 +1 @@
+SUCCESS
diff --git a/testsuite/gtk/ui/a11y2.ui b/testsuite/gtk/ui/a11y2.ui
new file mode 100644 (file)
index 0000000..8dc8bbf
--- /dev/null
@@ -0,0 +1,30 @@
+<interface>
+  <!-- test some accessible properties -->
+  <object class="GtkBox">
+    <child>
+      <object class="GtkButton">
+        <accessibility>
+          <property name="autocomplete">both</property>
+          <property name="description" translatable="yes">Bah</property>
+          <property name="has-popup">1</property>
+          <property name="key-shortcuts">shortcuts go here</property>
+          <property name="label" translatable="yes">label?</property>
+          <property name="level">99</property>
+          <property name="modal">no</property>
+          <property name="multi-line">0</property>
+          <property name="multi-selectable">false</property>
+          <property name="orientation">horizontal</property>
+          <property name="placeholder" translatable="yes">placeholder?</property>
+          <property name="read-only">F</property>
+          <property name="required">False</property>
+          <property name="role-description">Dunno</property>
+          <property name="sort">ascending</property>
+          <property name="value-max">11</property>
+          <property name="value-min">0</property>
+          <property name="value-now">10</property>
+          <property name="value-text" translatable="yes">Ten</property>
+        </accessibility>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/a11y3.expected b/testsuite/gtk/ui/a11y3.expected
new file mode 100644 (file)
index 0000000..ff43ca4
--- /dev/null
@@ -0,0 +1 @@
+SUCCESS
diff --git a/testsuite/gtk/ui/a11y3.ui b/testsuite/gtk/ui/a11y3.ui
new file mode 100644 (file)
index 0000000..1979f9b
--- /dev/null
@@ -0,0 +1,16 @@
+<!-- test accessible relations -->
+<interface>
+  <object class="GtkBox">
+    <child>
+      <object class="GtkButton">
+        <accessibility>
+          <relation name="labelled-by">label</relation>
+          <relation name="controls">label</relation>
+        </accessibility>
+      </object>
+    </child>
+    <child>
+      <object class="GtkLabel" id="label"/>
+    </child>
+  </object>
+</interface>